/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cz.tpj.database.obrazok_mesto;

import cz.tpj.util.ErrorDatabase;
import cz.tpj.util.Validation;

/**
 *
 * Slouží jako přepravka. Třída je koncipována podle databázové tabulky obrazok_mesto.
 * @author jabo
 */

public class CityPicture {
    private String id;
    private String pictureId;
    private String city_id;

    //-----------------konstruktor----------------------------------------------
    
    /**
     * knstruktor triedy CityPicture, vytvori instanciu danej triedy
     * @param id (mediumint 0 az 8388607)
     * @param picturesId (mediumint 0 az 8388607)
     * @param city_id (smallitn 0 az 32767)
     * @throws cz.tpj.util.ErrorDatabase
     */
    
    public CityPicture(String id, String picturesId, String city_id) throws ErrorDatabase {
        this.id = id;
        this.pictureId = picturesId;
        this.city_id = city_id;
    }
    
    /**
     * nastavi id 
     * @param id (mediumint 0 az 8388607)
     * @throws cz.tpj.util.ErrorDatabase
     */
    
    //-------------------------metody-------------------------------------------
    public void setId(String id) throws ErrorDatabase {
        Validation val = new Validation();
        this.id = val.validatedNumber("id", id, 0, 8388607);
    }
    
    /**
     * nastavi id obrazku mesta
     * @param pictureId (mediumint 0 az 8388607)
     * @throws cz.tpj.util.ErrorDatabase
     */
    
    public void setPictureId(String pictureId) throws ErrorDatabase {
        Validation val = new Validation();
        this.pictureId = val.validatedNumber("pictureId", pictureId, 0, 8388607);
    }
    
    /**
     * nastavi id mesta pre obrazok
     * @param cityId (smallint 0 az 32767)
     * @throws cz.tpj.util.ErrorDatabase
     */
    
    public void setCityId(String cityId) throws ErrorDatabase {
        Validation val = new Validation();
        this.city_id = val.validatedNumber("cityId", cityId, 0, 32767);
    }
    
    /**
     * vrati id (mediumint 0 az 8388607)
     * @return id
     */

    public String getId(){
        return id;
    }
    
    /**
     * vrati id obrazku (mediumint 0 az 8388607)
     * @return pictureId
     */
    
    public String getPictureId(){
        return pictureId;
    }
    
    /**
     * vrati id mesta (smallint 0 az 32767)
     * @return city_id
     */
    
    public String getCityId(){
        return city_id;
    }
}
